<div class="blade-static __bottom __expanded" ng-if="blade.mode">
    <div class="form-input" ng-if="blade.currentEntity.requireLicenseAcceptance">
        <div class="form-control __checkbox">
            <label class="form-label">
                <!--blade.currentEntity.validationErrors.length>0 ||-->
                <input type="checkbox" ng-model="blade.currentEntity.licenseAccepted" ng-disabled="!blade.currentEntity || isInstalling">
                <span class="check"></span>
                <span class="name">{{ 'platform.blades.module-detail.labels.i-accept-the' | translate }} <a ng-href="{{blade.currentEntity.licenseUrl}}" ng-if="blade.currentEntity.licenseUrl" target="_blank">{{ 'platform.blades.module-detail.labels.license-link' | translate }}</a> {{ 'platform.blades.module-detail.labels.agreement' | translate }}</span>
            </label>
        </div>
    </div>
    <button class="btn" ng-click="confirmActionInDialog(blade.mode)" ng-if="blade.currentEntity" ng-disabled="!blade.allowInstallModules || isInstalling || (blade.currentEntity.requireLicenseAcceptance && !blade.currentEntity.licenseAccepted)">
        <span ng-if="blade.mode === 'install'">{{'platform.commands.install' | translate}}</span>
        <span ng-if="blade.mode === 'update'">{{'platform.commands.update' | translate}}</span>
    </button>
</div>
<div class="blade-content">
    <div class="blade-inner">
        <div class="inner-block">
            <div ng-if="!blade.allowInstallModules" class="form-group form-error inner-block">
	        {{ 'platform.blades.modules-list.labels.manual-install-disabled' | translate }}
	    </div>
            <div ng-if="blade.mode === 'advanced' && blade.allowInstallModules" va-permission="platform:module:manage">
                <div class="t __divider">{{ 'platform.blades.module-detail.labels.install-from-file' | translate }}</div>
                <div class="form-group" ng-if="!blade.isLoading">
                    <label class="form-label">{{ 'platform.blades.module-detail.labels.select-module-file' | translate }}</label>
                    <div class="form-input">
                        <input type="file" uploader="uploader" nv-file-select>
                        <input type="text" readonly="">
                        <button class="btn __file" type="button" onclick="$('input[type=file]').trigger('click')">
                            <i class="btn-ico fa fa-file-archive-o"></i>
                        </button>
                    </div>
                </div>
            </div>
            <div ng-show="uploader.isUploading">
                <div class="sub-t">{{ 'platform.blades.module-detail.labels.upload-progress' | translate }}</div>
                <div class="progress-bar __aqua" ng-style="{'width': uploader.progress + '%'}"></div>
            </div>
            <ul ng-if="blade.currentEntity">
                <div class="t __divider">{{ 'platform.blades.module-detail.labels.module-info' | translate }}
                    <img class="t-ico" src="/images/approval-32.png" title="{{ 'platform.blades.module-detail.labels.official' | translate: blade.currentEntity }}" ng-if="blade.currentEntity.$isOwnedByVirto" />
                </div>
                <ul class="list __info">
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.title' | translate }}</div>
                        <div class="list-descr">{{blade.currentEntity.title}}</div>
                    </li>
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.owners' | translate: blade.currentEntity }}</div>
                    </li>
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.authors' | translate }}</div>
                        <ul class="list">
                            <li class="list-item" ng-repeat="author in blade.currentEntity.authors">
                                <div class="list-descr">{{author}}</div>
                            </li>
                        </ul>
                    </li>
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.id' | translate }}</div>
                        <div class="list-descr">{{blade.currentEntity.id}}</div>
                    </li>
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.version' | translate }}</div>
                        <div class="list-descr">{{blade.currentEntity.version}}</div>
                    </li>
                    <li class="list-item">
                        <a class="list-link" ng-if="blade.currentEntity.licenseUrl" ng-href="{{blade.currentEntity.licenseUrl}}" target="_blank">{{ 'platform.blades.module-detail.labels.license' | translate }}</a>
                        <a class="list-link" ng-if="blade.currentEntity.projectUrl" ng-href="{{blade.currentEntity.projectUrl}}" target="_blank">{{ 'platform.blades.module-detail.labels.project-information' | translate }}</a>
                    </li>
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.description' | translate }}</div>
                        <div class="list-descr">{{blade.currentEntity.description}}</div>
                    </li>
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.platform-version' | translate }}</div>
                        <div class="list-descr">{{blade.currentEntity.platformVersion}}</div>
                    </li>
                    <li class="list-item" ng-if="blade.currentEntity.dependencies">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.dependencies' | translate }}</div>
                        <div class="list-descr">
                            <div ng-repeat="dependency in blade.currentEntity.dependencies">
                                <a class="__link" ng-click="openDependencyModule(dependency)">{{dependency.id}}</a> {{formDependencyVersion(dependency)}}
                            </div>
                        </div>
                    </li>
                    <li class="list-item">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.tags' | translate }}</div>
                        <ul class="list __tags">
                            <li class="list-item" ng-repeat="tag in blade.currentEntity.tagsArray track by $index">
                                <i class="list-ico fa fa-tags"></i>
                                <div class="list-name">{{tag}}</div>
                            </li>
                        </ul>
                    </li>
                    <div class="form-group" ng-if="blade.mode">
                        <label class="form-label">{{ 'platform.blades.module-detail.labels.install-version' | translate }}</label>
                        <div class="form-input">
                            <ui-select ng-model="blade.currentEntity">
                                <ui-select-match>{{$select.selected.version}}</ui-select-match>
                                <ui-select-choices repeat="x in availableVersions | filter: {version: $select.search}">
                                    <span ng-bind-html="x.version | highlight: $select.search"></span>
                                </ui-select-choices>
                            </ui-select>
                        </div>
                    </div>
                    <li class="list-item" ng-if="blade.currentEntity.validationErrors.length">
                        <div class="list-t">{{ 'platform.blades.module-detail.labels.errors' | translate }}</div>
                        <div class="list-descr error">
                            <span ng-repeat="x in blade.currentEntity.validationErrors">{{x}}<br></span>
                        </div>
                    </li>
                </ul>

                <va-widget-container group="moduleDetail" blade="blade" gridster-opts="{columns: 3}" ng-if="!blade.mode"></va-widget-container>
        </div>
    </div>
</div>
